package edu.nf.service.impl;



import edu.nf.beans.annotations.Component;
import edu.nf.dao.FindAllDepartmDao;
import edu.nf.entity.Departm;
import edu.nf.exception.QueryException;
import edu.nf.service.FindAllDepartmService;

import java.util.List;

@Component("findAllDepartmService")
public class FindAllDepartmServiceImpl implements FindAllDepartmService {

    @Inject(beanName = "findAllDepartmDao")
    private FindAllDepartmDao dao;

    @Override
    public List<Departm> findAllDepartm() {
        List<Departm> list = dao.findAllDepartm();
        if(list == null) {
            throw new QueryException("find  Department fail.");
        }
        return list;
    }

}
